package com.ajavaer.framework.handle;

import com.ajavaer.framework.pay.response.WeixinOrderQueryResponse;

import java.math.BigDecimal;
import java.util.Map;

public interface WeixinPayHandle<T> {
    /**
     * 接到回调信息
     *
     * @param params
     * @throws Exception
     */
    void onMessage(Map<String, String> params) throws Exception;

    /**
     * 获取订单
     *
     * @param out_trade_no
     * @return
     */
    T getByOutTradeNo(String out_trade_no);

    /**
     * 校验订单金额
     *
     * @param t
     * @param total_amount
     * @return
     */
    boolean checkOrderByAmount(T t, BigDecimal total_amount);

    /**
     * 进行业务逻辑
     *
     * @param t
     * @param weixinOrderQueryResponse
     */
    void business(T t, WeixinOrderQueryResponse weixinOrderQueryResponse);
}
